package com.hillstone.component.cloud.ngcv.component.aop.annotation;

import java.lang.annotation.*;

/**
 * @author wangjian2
 * @date 2022/3/14 10:05
 * @descripton
 */
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface RedisLock {
    /**
     * 传入String作为redis分布式锁的key值，redisKey=NGCV:LOCK:keyPrefix-key
     * @return
     */
    String key();

    /**
     * 传入key为变量，且keyPrefix为传入时，取包名和方法名作为keyPrefix;
     * 传入key为常量, 则不添加keyPrefix
     * @return
     */
    String keyPrefix() default "";
    long tryLockTime() default -1;
}
